<%--
  Created by IntelliJ IDEA.
  User: LS-Z
  Date: 2022/6/24
  Time: 11:01
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
  <head>
    <title>$Title$</title>

    <script src="${pageContext.request.contextPath}/statics/js/jquery-3.6.0.js"></script>

    <script>
        <%--$ === jQuery--%>
        function a(){
          $.post({
            url:"${pageContext.request.contextPath}/a1",
            data:{"name":$("#username").val()},
            success:function (date,status){
              console.log("date->"+date);
              console.log("status->"+status);//200  300 400 500
            },
            error:function (){

            }
          })
        }
    </script>

  </head>
  <body>
  
  <%--  失去焦点的时候发起一个请求(携带信息)到后台--%>
  用户名: <input type="text" id="username" onblur="a()">

  </body>
</html>
